<template>
  <div>
    <z-table
      :title="tableOptions.title"
      :searchSchemas="searchSchemas"
      :tableProps="tableProps"
      :actionColumn="tableOptions.actionColumn"
      :dataSourceApi="tableOptions.dataSourceApi"
    >
      <template #header>
        <NButton primary type="primary"> 新建 </NButton>
      </template>
    </z-table>
  </div>
</template>

<script lang="tsx" setup>
import ZTable from "@components/Table/ZTable.vue";
import { reactive } from "vue";
import { getColumns, getSearchSchemas } from "./data";
import { getBusinessConfigList } from "@/api/nopig";
import { genBasicActions } from "@/components/Table/helpers/actions";

const searchSchemas = getSearchSchemas();

const tableProps: any = reactive({
  bordered: true,
  striped: true,
  columns: getColumns(),
  pagination: false,
  scrollX: 1800,
  maxHeight: 500,
});

const tableOptions = reactive({
  title: "应用场景",
  actionColumn: genBasicActions(
    () => undefined,
    () => undefined,
    "right"
  ),
  dataSourceApi: getBusinessConfigList,
});
</script>
